﻿using OF.Component.BLL;
using OF.Component.Model;
using OF.Utility;
using OpSystem.common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace OpSystem.manage.authority
{
    public partial class AuthorityPwdEdit : BasePage
    {
        protected string Message = "";
        private int UserId {
            get {
                return RequestUtility.GetQueryInt("id", -1);
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            CheckPageCode("10104");
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {
            AuthorityUserInforInfo info = AuthorityUserInforOperate.GetByID(UserId);
            if (info != null)
            {
              //  AuthorityUserInforInfo oldinfo = ObjectCopy<AuthorityUserInforInfo>.DeepCopy(info);
                info.PassWord = SecurityUtility.EncryptAsc(this.txtPwd.Text);
                AuthorityUserInforOperate.Update(info);
              //  OpOperationLogOperate.SetLog(oldinfo, info, OpUserID, OpUserInfo.OpUserName, (short)LogType.OpUserManage,info.OpUserID);
                
                Message = " BMCW.msg(\"修改密码成功\",\"" + GetPageUrl("Authorityuserlist.aspx") + "\",true);";
            }
            else
            {
                Message = " BMCW.alert('登陆名已经存在，请重新输入！');";
            }
        }
    }
}